{% load static %}
<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Probiotics</title>
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/jquery.cookie@1.4.1/jquery.cookie.min.js"></script>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
        crossorigin="anonymous">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
        crossorigin="anonymous"></script>
    <style>
        body {
            margin: 0;
            width: 100vw;
        }

        .container {
            max-width: 640px;
            margin: auto;
            padding: 12px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            height: 100vh;
        }
    </style>
</head>

<body>

    <div v-scope class="container">
        <div style="font-size: 1.5rem; margin-bottom: 4px;">
            Probiotics
        </div>
        <ul class="nav nav-tabs">
            <li class="nav-item">
                <a class="nav-link" aria-current="page" href="/">Home</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="/serve/">Serve</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="{% static 'data.csv' %}" download="data.csv">Download</a>
            </li>
        </ul>

        {% block content %}

        {% endblock %}

    </div>

    <script>
        const nav = document.querySelector('.nav')
        for(const item of nav.children){
            const child = item.firstElementChild
            console.log(location.href)
            console.log(child.href)
            if(child.href === location.href)child.classList.toggle('active')
        }

    </script>

</body>

</html>